import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import Es6Promise from 'es6-promise';
import ElementUI from 'element-ui';
import BaiduMap from 'vue-baidu-map';
import globalComponent from './globalComponents/index';
import 'element-ui/lib/theme-chalk/index.css';
import navConfig        from  './config/navConfig';
import  common          from  './common/common';
import  route_          from  './common/route';
import  config_         from  './config/config';                 //   配置文件
import  api from './api/index';    //api接口
import  raxios          from  './api/raxios';         //  封装的 axios 方法

import mapapi from './config/mapApiconfig';               //   接口列表
new route_(Vue);                                      //   路由全局处理
new common(Vue)
// 富文本编辑器
import  VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
import imgPreview from 'components/imgPreview'
import moment from 'moment'//导入文件

import defaultImg from './common/defaultImg';
Vue.use(defaultImg);



Vue.use(VueQuillEditor);
Es6Promise.polyfill();
Vue.use(ElementUI);
Vue.use(BaiduMap, {
 ak: 'F3r6Hq4h8j1TcG8sahZVYjIjgzSs1t7G'
})
Vue.use(imgPreview)
globalComponent(Vue);                 // 全局组件挂载


Vue.prototype.$raxios = raxios();

Vue.config.productionTip = false;
Vue.prototype.$navConfig = navConfig;
Vue.prototype.$navigator=window.$navigator;
Vue.prototype.$config  = config_;
Vue.prototype.$mapapi  = mapapi;
Vue.prototype.$api  = api;
Vue.prototype.$message = ElementUI.Message;

Vue.prototype.$moment = moment;//赋值使用
moment.locale('zh-cn');//需要汉化
//刚开始第一次进入页面的时候，为了防止拿不到之前保留的token，先取拿一次内存
localStorage.getItem("store") && store.replaceState(Object.assign(store.state, JSON.parse(localStorage.getItem("store"))));

// （q：查看详情，i：录入，m：修改，d：删除，c：审核）

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
